package com.yanqu.road.server.cmd.wingroom.workshop;

import com.yanqu.road.pb.wingroom.WingRoomProto;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.command.Command;
import com.yanqu.road.server.manger.wingroom.WingRoomMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.GameProtocol;
import io.netty.channel.ChannelHandlerContext;

/**
 * @author ：zfr
 * @date ：2022/2/23 22:02
 */
@Cmd(code = GameProtocol.S_WING_ROOM_WORK_SHOP_POOL_SYNC, desc = "工坊刷新同步")
public class WorkShopPoolSyncCmd implements Command {
    @Override
    public void execute(ChannelHandlerContext ctx, YanQuMessage packet) throws Exception {
        WingRoomProto.WorkShopPoolTemp workShopPoolMsg = WingRoomProto.WorkShopPoolTemp.parseFrom(packet.getBytes());
        WingRoomMgr.refreshWorkShopPoolMsg(workShopPoolMsg.toBuilder());
    }
}
